<?php

require('base.php');

class Service extends Base {
	
	function Service() {
		parent::Base();
		$this->database();
	}
	
	function index($language) {
		$this->language( $language, 'base' );
		
		$service_list = $this->db->find("select * from service where language='$language'");
		
		$page = $this->db->find_row("select * from page where language='$language' and url_pattern='service'");
		
		$meta = array(
			'title' 		=> $page['title'],
			'keywords'		=> $page['keywords'],
			'description'	=> $page['description']
		);
		
		$data = array(
			'service_list' 	=> $service_list,
			'page' 			=> $page,
			'meta'			=> $meta
		);
		
		$this->layout('portal/service_main', $data);
	}
	
	function show($up, $language) {
		$this->language( $language, 'base' );
		
		$service_list = $this->db->find("select * from service where language='$language'");
		$service = $this->db->find_row("select * from service where language='$language' and url_pattern='$up'");
		
		$meta = array(
			'title' 		=> $service['title'],
			'keywords'		=> $service['keywords'],
			'description'	=> $service['description']
		);
		$data = array(
			'service_list'	=> $service_list,
			'service' 		=> $service,
			'meta'			=> $meta
		);
		
		$this->layout('portal/service', $data);
	}
	
}

?>